<template>
  <el-row class="tables">
    <!-- 表格 头部 -->
    <el-row class="tableTh">
      <el-col :span="2">
        <span>序号</span>
      </el-col>
      <el-col :span="4">
        <span>设备名称</span>
      </el-col>
      <el-col :span="5">
        <span>故障类型</span>
      </el-col>
      <el-col :span="4">
        <span>负责人</span>
      </el-col>
      <el-col :span="5">
        <span>要求完成时间</span>
      </el-col>
      <el-col :span="4">
        <span>状态</span>
      </el-col>
    </el-row>
    <!-- 表格行 -->
    <div v-if="centerBottomTab.length > 0" class="showDiv">
      <el-row v-for="(item,index) in centerBottomTab" :class="{ 'row-striped': index % 2 === 1 }" :key="item.id" class="tableTd">
        <el-col :span="2">
          <span>{{ index }}</span>
        </el-col>
        <el-col :span="4">
          <span>{{ item.equipName }}</span>
        </el-col>
        <el-col :span="5">
          <span>{{ item.classifyName }}</span>
        </el-col>
        <el-col :span="4">
          <span>{{ item.responsiblePersonName }}</span>
        </el-col>
        <el-col :span="5">
          <span>{{ item.endTime }}</span>
        </el-col>
        <el-col :span="4">
          <span>{{ item.statusStr}}</span>
        </el-col>
      </el-row>
    </div>
    <div v-else class="kong">暂无数据</div>
  </el-row>
</template>
<script>
export default {
  props: {
    centerBottomTab: {
      type: Array,
      default: []
    }
  },
  data() {
    return {
      tableData: [
        {
          ytype: '1',
          materialName: 'v08-制瓶机',
          materialCode: '制瓶机常规保养',
          model: '庄宏伟',
          num: '2024-02-01 16:00',
          batch: '超期未处理'
        },
        {
          ytype: '2',
          materialName: 'v21-制瓶机',
          materialCode: '制瓶机巡检',
          model: '刘明',
          num: '2024-02-01 16:00',
          batch: '待验收'
        },
        {
          ytype: '3',
          materialName: 'v03-上管机',
          materialCode: '制瓶工艺巡检',
          model: '刘刚',
          num: '2024-02-01 16:00',
          batch: '待验收'
        },
        {
          ytype: '4',
          materialName: 'v03-制瓶机',
          materialCode: '油路故障',
          model: '颜剑锋',
          num: '2024-02-01 16:00',
          batch: '待验收'
        },
        {
          ytype: '5',
          materialName: 'v01-退火炉',
          materialCode: '制瓶机巡检',
          model: '刘明',
          num: '2024-02-01 16:00',
          batch: '待处理'
        },
        {
          ytype: '6',
          materialName: 'v08-检测输送',
          materialCode: '设备故障',
          model: '庄宏伟',
          num: '2024-02-01 16:00',
          batch: '待处理'
        }
      ]
    }
  },
  watch: {},
  mounted() {},
  methods: {}
}
</script>
<style lang='scss' scoped>
.row-striped {
  background-color: #305483; /* 背景色可以根据需要自定义 */
}
.tables {
  height: calc(100% - 30px);
  color: #fff;
  background: #101747;
  margin: 0 20px;
  .showDiv {
    height: 85%;
  }
  .tableTh,
  .tableTd {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    .el-col {
      text-overflow: ellipsis; /*让截断的文字显示为点点。还有一个值是clip意截断不显示点点*/
      white-space: nowrap; /*让文字不换行*/
      overflow: hidden; /*超出要隐藏*/
    }
  }
  .tableTh {
    width: 100%;
    height: 15%;
    // font-weight: bold;
    font-size: 12px;
    background: #396ba2;
  }
  .tableTd {
    height: 16.666666%;
    font-size: 12px;
    // font-weight: bold;
  }
  .kong {
    height: calc(100% - 65px);
    // background: url(../../../../assets/images/zwsj.png) no-repeat center;
    background-size: 50% auto;
    display: flex;
    align-items: center;
    justify-content: center; /*定义body的里的元素水平居中*/
    color: #fff;
    font-size: 0.8vw;
  }
}
</style>
